import 'package:flutter/cupertino.dart';
import 'package:bilibili/core/extension/int_extension.dart';
import 'package:flutter/material.dart';

class HomeListView {
  static final List<String> imageUrl = [
    "https://i1.hdslb.com/bfs/archive/2f92dfa1bffc2dc4383527f5f8a3f1d1bc73114d.jpg@412w_232h_1c.webp",
    "https://i0.hdslb.com/bfs/archive/7e8b06e70592aa9bd56f0ca4fcf1f3c0160a0718.jpg@412w_232h_1c.webp",
    "https://i1.hdslb.com/bfs/archive/30b4fa65530cdbb180a493c9eb11167f2ba8a3de.jpg@412w_232h_1c.webp",
    "https://i2.hdslb.com/bfs/archive/0c9a9ef079bd06233af9c5a7f34f4fc829293964.jpg@412w_232h_1c.webp",
    "https://i2.hdslb.com/bfs/archive/faca4f5ad119130f263296b2df326cc7d0a066df.jpg@412w_232h_1c.webp",
    "https://i2.hdslb.com/bfs/archive/e6f944dcdbcda88c0b639826538e66b2546e1f4f.jpg@412w_232h_1c.webp",
    "https://i2.hdslb.com/bfs/archive/c8e9c52f0ec9125f5494f4645df28588aea9d3ab.jpg@412w_232h_1c.webp",
    "https://i1.hdslb.com/bfs/archive/6b7365a5dae0333281a7c7dda79612e8155c95d9.jpg@412w_232h_1c.webp",
    "https://i2.hdslb.com/bfs/archive/79fa6ae0ddb38f2d067ccfc8ddd96d31e2adc4bf.jpg@412w_232h_1c.webp",
    "https://i1.hdslb.com/bfs/archive/17d9c2210d492f355546f7702cb7f24e685133e2.jpg@412w_232h_1c.webp",

  ];

  static final List<String> imageText = [
    "【黑神话之悟空】主题音乐纯女声版（去除黄眉老妖妖言惑众）",
    "【整活】 既见未来，为何不拜 [黑神话·悟空]",
    "第一次当CEO！探秘中国手机品牌怎样席卷海外？",
    "恶臭网红无耻行为鉴定：直播“扮鬼”博眼球，偷走救生艇装英雄？",
    "【建议收藏】看了我的指南，买笔记本电脑全程绝不翻车！",
    "跟我大司马拼，你有这个实力吗？",
    "“纵有疾风起，生命不言弃”",
    "我在游戏里把街机厅玩了个遍！",
    "【游戏侦查冰】宝开歧视中国玩家？《植物大战僵尸2》真的是垃圾游戏吗？",
    "《黑神话：悟空》12分钟UE5实机测试集锦"

  ];

  static final List<String> imageInfo = [
    "https://www.bilibili.com/video/BV1Fq4y1U7JQ",
    "https://www.bilibili.com/video/BV1JP4y1p7au",
    "https://www.bilibili.com/video/BV1vv411A7H1",
    "https://www.bilibili.com/video/BV1Q64y1e77s",
    "https://www.bilibili.com/video/BV14v411A7VW",
    "https://www.bilibili.com/video/BV14g411L7PV",
    "https://www.bilibili.com/video/BV1bL411b7kF",
    "https://www.bilibili.com/video/BV1ev411N7St",
    "https://www.bilibili.com/video/BV12y4y137sE",
    "https://www.bilibili.com/video/BV1y64y1q757"

  ];

  static Widget buildHomeListView(BuildContext context) {

    return GridView.builder(
      padding: EdgeInsets.all(4.px),
      physics: NeverScrollableScrollPhysics(),
      itemCount: 10,
      shrinkWrap: true,
      itemBuilder: (ctx, index) {
         return Card(
            shape: BeveledRectangleBorder(
              borderRadius: BorderRadius.circular(8.px)
            ),
            child: Column(
              children: [
                Image.network(imageUrl[index], width: double.infinity, fit: BoxFit.fitWidth,),
                Expanded(
                  child: Padding(
                    padding: const EdgeInsets.all(8.0),
                    child: Text(imageText[index], style: TextStyle(fontSize: 20.px), maxLines: 2,),
                  )
                )
              ],
            ),
        );
      },
      gridDelegate:
          SliverGridDelegateWithFixedCrossAxisCount(
            crossAxisCount: 2,
            childAspectRatio: 6/5,
            crossAxisSpacing: 4.px
          ),
    );
  }
}